package com.fr.privilege.authority;

import com.fr.base.XMLable;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public final class Authority
  implements XMLable
{
  public static final String XML_TAG = "Authority";
  private String name;

  public Authority()
  {
  }

  public Authority(String paramString)
  {
    this.name = paramString;
  }

  public String getName()
  {
    return this.name;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    throw new UnsupportedOperationException("The readXML method can not be accessed.");
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Authority").attr("name", this.name);
    paramXMLPrintWriter.end();
  }

  public boolean equals(Object paramObject)
  {
    return ((paramObject instanceof Authority) && (ComparatorUtils.equals(((Authority)paramObject).name, this.name)));
  }

  public int hashCode()
  {
    return ((this.name == null) ? 0 : this.name.hashCode());
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public String toString()
  {
    return this.name;
  }
}